<!DOCTYPE html>
<html>
<head>
	
	<title><?php echo _MANAGER_TITLE_; ?></title>

	<?php $this->setFlag('list,vue'); ?>
	<?php $this->import('meta'); ?>

	<link rel="stylesheet" type="text/css" href="html/manager/other/css/list.css?v=10" />

    <script type="text/javascript" src="html/manager/other/js/list.js?v=13"></script>

</head>
<body>

	<div id="mainBg" class="bg" style="display: none;">

		<input type="text" id="tempid" class="display-none" />
		<input type="text" id="menuid" class="display-none" />
		<input type="text" id="flag" class="display-none" />

		<div class="title-bar2">
            <div class="title2">其他服务</div>
            <button id="addInfoBtn" type="button" class="layui-btn btnAdd" style="display: none;" onclick="addOther()">添加新信息</button>
            <button id="resetBtn" type="button" class="layui-btn layui-btn-primary btnDel" style="display: none;" onclick="resetSequence()">重新排序</button>
            <button id="sortationBtn" type="button" class="layui-btn layui-btn-primary btnDel" style="display: none;" onclick="toSortation()">管理分类</button>
        </div>

        <div class="query-bar">
            <div class="search-left">
                <select id="selectList1" class="ddlist" onchange="queryKey('ddl')">
                    <option value="1" selected="selected">展示中</option>
                    <option value="0">待审核</option>
                    <option value="2">下架</option>
                    <option value="3">回收</option>
                    <option value="4">已过期</option>
                    <option value="5">已退款</option>
                </select>
                <select id="selectList2" class="ddlist" onchange="queryKey('ddl')">
                	<option value="" selected="selected">全部分类</option>
                </select>
                <select id="selectList3" class="ddlist" onchange="queryKey('ddl')">
                	<option value="" selected="selected">全部区域</option>
                    <option value="1">置顶区</option>
                    <option value="0">普通区</option>
                </select>
            </div>
            <div class="search-right">
                <input type="text" id="keyword1" class="keyword" placeholder="请输入标题" autocomplete="off" />
                <button type="button" class="btnOk" onclick="queryKey('ok')">确定</button>
            </div>
        </div>

        <div class="tongji-bar">
            <span class="tongji">共<span id="listCount" class="tc1"></span>条信息</span>
        </div>

        <div id="listBar" class="table-bar">
        	<table class="table-box">
        		<tr class="tr-head">
                    <td class="td-head">标题 / 服务特征 / 服务范围 / 联系人与电话</td>
                    <td class="td-head hw2">剩余天数</td>
                    <td class="td-head hw3">栏目分类</td>
                    <td class="td-head hw3">显示区域</td>
                    <td class="td-head hw2">统计</td>
                    <td class="td-head hw3">状态</td>
                    <td class="td-head hw4">操作</td>
                </tr>
                <tr class="tr-item" v-for="info in list">
                    <td class="td-item-left">
                        <template v-if="info.company_verifyid != null && info.company_verifyid != ''">
                            <span class="tc5">[商家认证]</span>
                        </template>
                        <span class="tview" v-on:click="viewOther(info.otherid)">{{ info.title }}</span><br />
                        <span class="tc4">服务特征：</span>{{ info.feature }}<br />
                        <span class="tc4">服务范围：</span>{{ info.area }}<br />
                        <span class="tc4">联系方式：</span>{{ info.person }}，{{ info.phone }}
                    </td>
                    <td class="td-item-left hw2">
                        <span class="tc4">展示：</span><template v-if="info.expiretime != '永久'"><template v-if="info.showResidueDays <= 7"><span class="tc1">{{ info.showResidueDays }}</span></template>
                        <template v-else>{{ info.showResidueDays }}</template>天</template><template v-else>永久</template><br />
                        <template v-if="info.istop == 1">
                            <span class="tc4">置顶：</span><template v-if="info.topResidueDays <= 7"><span class="tc1">{{ info.topResidueDays }}</span></template>
                            <template v-else>{{ info.topResidueDays }}</template>天
                        </template>
                    </td>
                    <td class="td-item-center hw3">{{ info.sortation }}</td>
                    <td class="td-item-center hw3">
                        <template v-if="info.istop == 0">普通区</template>
                        <template v-else-if="info.istop == 1"><span class="tc1">置顶区</span></template>
                        <template v-else>--</template>
                    </td>
                    <td class="td-item-left hw2">
	                    <span class="tc4">点击：</span>{{ info.click }}<br />
	                    <span class="tc4">电话：</span>{{ info.dial }}
	                </td>
                    <td class="td-item-center hw3">
                        <template v-if="info.status == 0"><span class="tc1">待审核</span></template>
                        <template v-else-if="info.status == 1"><span class="tc2">展示中</span></template>
                        <template v-else-if="info.status == 2"><span class="tc3">下架</span></template>
                        <template v-else-if="info.status == 3"><span class="tc3">回收</span></template>
                        <template v-else-if="info.status == 4"><span class="tc3">已过期</span></template>
                        <template v-else-if="info.status == 5"><span class="tc3">已退款</span></template>
                        <template v-else>--</template>
                    </td>
                    <td class="td-item-center hw4">
                        <template v-if="info.status == 0">
                            <template v-if="permission.setstatus == 'yes'">
                                <span class="item-edit" v-on:click="putOther(info.otherid)">发布</span>
                                <span class="item-delete" v-on:click="retrieveOther(info.otherid)">回收</span>
                            </template>
                        </template>
                        <template v-else-if="info.status == 1">
                            <template v-if="info.istop == 0 && permission.settop == 'yes'">
                            	<span class="item-edit" v-on:click="topOther(info.otherid, info.expiretime)">置顶</span>
                            </template>
                            <template v-if="permission.setstatus == 'yes'">
                                <span class="item-delete" v-on:click="pullOther(info.otherid)">下架</span>
                            </template>
                        </template>
                        <template v-else-if="info.status == 2">
                            <template v-if="permission.setstatus == 'yes'">
                            	<span class="item-edit" v-on:click="putOther(info.otherid)">上架</span>
                            </template>
                            <template v-if="permission.deleteinfo == 'yes'">
                                <span class="item-delete" v-on:click="deleteOther(info.otherid)">删除</span>
                            </template>
                        </template>
                        <template v-else-if="info.status == 3">
                            <template v-if="permission.setstatus == 'yes'">
                                <span class="item-edit" v-on:click="restoreOther(info.otherid)">恢复</span>
                            </template>
                            <template v-if="permission.deleteinfo == 'yes'">
                                <span class="item-delete" v-on:click="deleteOther(info.otherid)">删除</span>
                            </template>
                        </template>
                        <template v-else-if="info.status == 4">
                            <template v-if="permission.setstatus == 'yes'">
                            	<span class="item-edit" v-on:click="putOtherAgain(info.otherid)">重新发布</span>
                            </template>
                        </template>
                        <template v-else-if="info.status == 5">
                        </template>
                        <template v-else>
                            <span class="tc1">状态有误</span>
                        </template>
                        <template v-if="permission.editinfo == 'yes' || permission.viewlog == 'yes'">
                            <select class="ddlMenu" v-on:change="clickOperateItem(info.otherid, info.title, info.sortation, $event)">
                                <option value="" selected="selected">操作项</option>
                                <template v-if="permission.editinfo == 'yes'">
                                    <option value="edit">编辑信息</option>
                                    <template v-if="info.company_verifyid == null || info.company_verifyid == ''">
                                        <option value="company">商家认证</option>
                                    </template>
                                    <template v-if="info.status == 1">
                                        <option value="tweet">微信推送</option>
                                        <option value="exclusive">首页专属推荐</option>
                                    </template>
                                </template>
                                <template v-if="permission.viewlog == 'yes'">
                                    <option value="log">日志记录</option>
                                </template>
                            </select>
                        </template>
                    </td>
                </tr>
        	</table>
        </div>

        <?php $this->import('page'); ?>
        <?php $this->import('slipiframe'); ?>

        <script type="text/javascript">
        	var other = new Vue({
	            el: '#listBar',
	            data: {
	                list: '',
	                permission: ''
	            }
	        });
        </script>

        <div id="writeBar1" style="display: none;">
            <div class="write-bar">
                <div id="writeTitle" class="write-title">置顶</div>
                <div class="write-content">
                    <div class="write-tr1">
                        <div class="write-field1">置顶类型：</div>
                        <div class="write-value1">
                            <input type="radio" name="toptype" class="write-chenk1" value="1" />收费置顶
                            <input type="radio" name="toptype" class="write-chenk2" value="2" />赠送置顶
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">置顶时长：</div>
                        <div class="write-value1">
                            <input type="radio" name="toptime" class="write-chenk1" value="0" onclick="setTopEndtime(30)" />1个月
                            <input type="radio" name="toptime" class="write-chenk2" value="1" onclick="setTopEndtime(92)" />3个月
                            <input type="radio" name="toptime" class="write-chenk2" value="2" onclick="setTopEndtime(183)" />半年
                            <input type="radio" name="toptime" class="write-chenk2" value="3" onclick="setTopEndtime(365)" />1年
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">结束时间：</div>
                        <div class="write-value1">
                            <input type="text" id="topendtime" class="write-input1 po1" placeholder="请选择结束时间" autocomplete="off" />
                            <input type="text" id="expiretime" class="display-none" />
                            <span id="expiretimeTip" class="tc1"></span>
                        </div>
                    </div>
                </div>
                <div class="write-button">
                    <div class="write-button-ok" onclick="saveTopOther()">确定</div>
                    <div class="write-button-cancel" onclick="closeWriteDiv()">取消</div>
                </div>
            </div>
        </div>

        <div id="writeBar2" style="display: none;">
            <div class="write-bar">
                <div id="writeTitle" class="write-title">重新发布</div>
                <div class="write-content">
                    <div class="write-tr1">
                        <div class="write-field1">展示时长：</div>
                        <div class="write-value1">
                            <input type="radio" name="showtime" class="write-chenk1" value="0" onclick="setExpiretime(30)" />1个月
                            <input type="radio" name="showtime" class="write-chenk2" value="1" onclick="setExpiretime(92)" />3个月
                            <input type="radio" name="showtime" class="write-chenk2" value="2" onclick="setExpiretime(183)" />半年
                            <input type="radio" name="showtime" class="write-chenk2" value="3" onclick="setExpiretime(365)" />1年
                            <input type="radio" name="showtime" class="write-chenk2" value="4" onclick="setExpiretime(3650)" />不限制
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">到期时间：</div>
                        <div class="write-value1">
                            <input type="text" id="expiretime" class="write-input1 po1" placeholder="请选择到期时间" autocomplete="off" />
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">初始状态：</div>
                        <div class="write-value1">
                            <input type="radio" name="status" class="write-chenk1" value="0" />待审核
                            <input type="radio" name="status" class="write-chenk2" value="1" checked="checked" />展示中
                        </div>
                    </div>
                </div>
                <div class="write-button">
                    <div class="write-button-ok" onclick="saveAgainOther()">确定</div>
                    <div class="write-button-cancel" onclick="closeWriteDiv()">取消</div>
                </div>
            </div>
        </div>

	</div>

</body>
</html>